package com.hznu.stmanage.serviceImpl;

import com.hznu.stmanage.dao.LogMapper;
import com.hznu.stmanage.entity.Log;
import com.hznu.stmanage.service.BaseService;
import com.hznu.stmanage.service.LogService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by J_Vino on 16/3/6.
 */
@Transactional(rollbackFor = Exception.class)
@Service
public class LogServiceImpl extends BaseService implements LogService {

    LogMapper logMapper = null;
    public void setMapper()
    {
        if(logMapper==null)
            logMapper = getLogMapper();//1.获取相关mapper
    }
    public int deleteByPrimaryKey(Long id) {
        setMapper();
        return logMapper.deleteByPrimaryKey(id);
    }

    public int insert(Log record) {
        setMapper();
        return logMapper.insert(record);
    }

    public int insertSelective(Log record) {
        setMapper();
        return logMapper.insertSelective(record);
    }

    public Log selectByPrimaryKey(Long id) {
        setMapper();
        return logMapper.selectByPrimaryKey(id);
    }

    public int updateByPrimaryKeySelective(Log record) {
        setMapper();
        return logMapper.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKey(Log record) {
        setMapper();
        return logMapper.updateByPrimaryKey(record);
    }
}
